def number_to_chinese(num):
    if not isinstance(num, (int, float)):
        raise ValueError("输入必须是整数或浮点数")

    unit_map = ["", "十", "百", "千", "万", "十", "百", "千", "亿", "十", "百", "千", "万亿"]
    digit_map = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"]

    def helper(n):
        result = ""
        zero_flag = False
        for i, digit in enumerate(reversed(str(n))):
            digit = int(digit)
            if digit == 0:
                zero_flag = True
            else:
                if zero_flag:
                    result = "零" + result
                    zero_flag = False
                result = digit_map[digit] + unit_map[i] + result
        return result

    integer_part, decimal_part = str(num).split(".") if "." in str(num) else (str(num), "")

    chinese_integer = helper(int(integer_part))
    chinese_decimal = "".join(digit_map[int(d)] for d in decimal_part[:2]) if decimal_part else ""

    if chinese_decimal:
        chinese_decimal = "点" + chinese_decimal

    # 处理特殊情况
    chinese_integer = chinese_integer.rstrip("零").replace("零零零", "零").replace("零零", "零")
    if chinese_integer.endswith("十"):
        chinese_integer = chinese_integer[:-1] + "一"

    return chinese_integer + chinese_decimal


# 测试
print(number_to_chinese(123456789.12))  # 输出: 一亿二千三百四十五万六千七百八十九点一二
print(number_to_chinese(100010001))  # 输出: 一亿零一千一百零一
